<template>
  <div class="exam-content">
    <div class="exam-body">
      <el-breadcrumb separator-class="el-icon-arrow-right">
        <el-breadcrumb-item :to="{ path: '/?type=1' }">首页</el-breadcrumb-item>
        <el-breadcrumb-item :to="{ path: '/?type=1' }">科目{{ types == 1 ? '一' : '四' }}</el-breadcrumb-item>
        <el-breadcrumb-item>章节练习</el-breadcrumb-item>
      </el-breadcrumb>
      <div class="exam-list">
        <div class="exam-item" v-for="item in examList" :key="item.id" @click="gotoExam(item.id)">
          <div>{{ item.name }}</div>
          <div class="exam-num">
            <!-- <div>{{ item.num }}题</div> -->
            <img src="@/assets/矩形 16.png" alt="" />
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
  
<script>
import { getChapterlist } from '@/api/index.js'
export default {
  name: "ChapterExercise",
  data() {
    return {
      types: 1,
      examList: [
      ],
    };
  },
  mounted() {
    this.types = this.$route.query.type
    this.init()
  },
  methods: {
    init() {
      let that = this;
      getChapterlist().then(res => {
        that.examList = res.list
      })
    },
    gotoExam(id) {
      this.$router.push({
        path: '/ExamExercise',
        query: {
          type: this.types,
          id,
          topicType:1
        }
      })
    }
  }
};
</script>
  
<style lang="scss">
.exam-body {
  padding: 1.5% 12.5%;
  background-color: #fff;

  .exam-list {
    margin-top: 2vh;
    border-top: 1px solid #e6e6e6;

    .exam-item {
      display: flex;
      justify-content: space-between;
      padding: 2vh 0;
      border-bottom: 1px solid #e6e6e6;
      cursor: pointer;

      .exam-num {
        display: flex;
        color: #999999;

        >img {
          width: 1vw;
          height: 2vh;
        }
      }
    }
  }
}
</style>